#!/bin/bash
#2020年2月10日22:00:30
#auto install nginx web
#by author www.jfedu.net
########################
NGX_SOFT="nginx-1.26.2.tar.gz"
NGX_DIR="/usr/local/nginx"
NGX_SRC="nginx-1.26.2"
NGX_YUM="yum install -y"
NGX_URL="http://nginx.org/download"
NGX_ARGS="--user=www --group=www  \
	--sbin-path=/usr/local/nginx/sbin/nginx \
	--conf-path=/usr/local/nginx/conf/nginx.conf \
	--error-log-path=/usr/local/nginx/logs/error.log \
	--http-log-path=/usr/local/nginx/logs/access.log \
	--pid-path=/usr/local/nginx/logs/nginx.pid \
	--lock-path=/var/lock/subsys/nginx \
	--with-http_stub_status_module \
	--with-http_ssl_module \
	--with-http_gzip_static_module \
	--with-pcre"
$NGX_YUM gcc pcre pcre-devel zlib zlib-devel
$NGX_YUM wget make openssl-devel net-tools
wget -c $NGX_URL/$NGX_SOFT
tar -xzvf $NGX_SOFT
cd $NGX_SRC
useradd -s /sbin/nologin www -M
./configure --prefix=$NGX_DIR $NGX_ARGS
make
make install
$NGX_DIR/sbin/nginx
ps -ef|grep nginx
netstat -ntl|grep 80
setenforce 0
systemctl stop firewalld.service
